<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            height: 300px;
            width: 600px;
            background-color: pink;
            /*背景渐变 必须加浏览器私有前缀 */
            /* background: -webkit-linear-gradient(left, green, red); */
            /* 默认渐变方向从上到下 */
            /* background: -webkit-linear-gradient(pink, blue); */
            background: -webkit-linear-gradient(left top, pink, blue);
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>